<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/sc/js/page.js"></script>
</head>

<body style="color:#333;padding:3px;">
<!-- 标题 -->
<div class="page-heade clearfix">
    <h2 class="clearfix text-center"><a class="col-md-6 title_color" id="Ap1"
                            style="display: inline-block;font-size: 16px;color:#333;" href='{:url("index")}'">TI费用需反馈申请</a> <a
            class="col-md-6 title_color H_right H_active" id="Ap2" style="font-size: 16px;display: inline-block;"
            href='{:url("index2")}'">TI费用反馈报告</a></h2>
</div>
<!-- 标题 -->
<div class="col-md-12 padding-10">
    <p class="colorRed">温馨提示：处于下列任意一种状态的申请单不能进行反馈操作，需反馈申请列表不予显示：<br>
        1.异动中、已异动、取消中、已取消的申请单;2.和小钟、部分核销、已核销、不予核销的申请单;3.已反馈、反馈中的申请单;4.没有明细的非常规促申请。</p>
</div>
<div class="form-inline">
     <form action="#" method="post" id="form_check" class="formpage">
     <input type="hidden" value='{$page}' name="page" id="page-go"/>
                      <input type="hidden" value='{$list}' name="list" id="list-go"/>
        <table class="row-margin-top tab-content table-bordered table text-center" border="1">
            <tr>
                <td><label for="" class="form-label">编号：</label><input type="text" class="form-control" name="no" value="{$data.no}"></td>
                <td><label for="">主题：</label><input type="text" class="form-control" name="title" value="{$data.title}"></td>
                <td><label for="">状态：</label>
                    <select name="status" id="state" class="form-control select" style="min-width: 100px;width: 100px">
                        <option value="0">请选择</option>
                         <option value="1" {if isset($data.status)&&$data.status==1}selected{/if}>草稿</option>
                        <option value="2" {if isset($data.status)&&$data.status==2}selected{/if}>已打回</option>
                        <option value="3" {if isset($data.status)&&$data.status==3}selected{/if}>区域领导审批</option>
                        <option value="4" {if isset($data.status)&&$data.status==4}selected{/if}>拆分人审批</option>
                        <option value="5" {if isset($data.status)&&$data.status==5}selected{/if}>集团领导审批</option>
                        <option value="6" {if isset($data.status)&&$data.status==6}selected{/if}>抄送</option>
                        <option value="7" {if isset($data.status)&&$data.status==7}selected{/if}>已归档</option>
                        <option value="8" {if isset($data.status)&&$data.status==8}selected{/if}>已作废</option>
                        <option value="9" {if isset($data.status)&&$data.status==9}selected{/if}>已否决</option>
                    </select></td>
                <td>
                    <div class="form-group">
                        申请时间
                    </div>
                    <div class="form-group">
                        <input type="text" id="start" placeholder="开始日期" class="form-control layer-date "
                               style="min-width:100px;height: 26px;display: inline-block;" name="start" value="{$data.start}">
                    </div>
                    <div class="form-group">
                        至
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control layer-date" placeholder="结束日期"
                               style="min-width:100px;height: 26px;display: inline-block;" id="end" name="end" value="{$data.end}">
                    </div>
                </td>
                <td>
                    <button class="btn btn-info btn-sm query" type="button" id="check">查询</button>
                    <button class="btn btn-info btn-sm emptyIf" type="button" id="clear_check">清空查询条件</button>
                </td>
            </tr>
        </table>

        <table class="table row-margin-top table-striped table-bordered text-center bud_hei">
            <tr class="info text-center">
                <th class="text-center">NO.</th>
                <th class="text-center">编号</th>
                <th class="text-center">主题</th>
                <th class="text-center">申请人</th>
                <th class="text-center">申请时间</th>
                <th class="text-center">状态</th>
                <th class="text-center">操作</th>
            </tr>
            {volist name="applys" id="row"}
            <tr>
                <td>{$i}</td>
                {if $row.state==8||$row.state==9}
                <td>{$row.no}</td>
                {else/}
                <td><a href="{:url('view',['id'=>$row.id])}" class="J_menuItem">{$row.no}</a></td>
                {/if}
                <td>{$row.title}</td>
                <td>{$row.c_user_id}</td>
                <td>{$row.created_on}</td>
                <td>{$row.statet}</td>
                <td>
                    {if $row.state==1}
                    <a onclick="tijiao({$row.id})">提交工作流</a>
                    <a onclick="qx({$row.id})">删除</a>
                    {elseif $row.state==2}
                    <a href="{:url('zuofei')}?id={$row.id}">作废</a>
                    <a href="{:url('Workflowdb/workflowchart',['id'=>$row.myId])}" class="J_menuItem" title="查看流程图">查看流程图</a>
                    {else}
                    <a href="{:url('Workflowdb/workflowchart',['id'=>$row.myId])}" class="J_menuItem" title="查看流程图">查看流程图</a>
                    {/if}
                </td>
            </tr>
            {/volist}
        </table>
          <h5 class="text-center" id="pagesc" style="font-size: 16px;font-weight: 500">
            <script>
                            $(function(){
                                pageSC("pagesc",{$sum},{$page},{$maxpage})
                            })
                        </script> 
                        每页显示
           <select id="pagesize">
                        <option value='20' {if condition="$list eq 20"}selected{/if}>20条</option>
                        <option value='40'{if condition="$list eq 40"}selected{/if}>40条</option>
                        <option value='50'{if condition="$list eq 50"}selected{/if}>50条</option>

            </select>
        </h5>
    </form>
</div>
<!-- 全局js -->
{include file="Public/footer"}

<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<script src="__STATIC__/layout/js/contabs_sub.js"></script>
<script>
    $('.J_menuItem').on('click', menuItem);
</script>
<script>
 //提交工作流
    function tijiao(id){
         swal({
            title: "提示",
            text: "您真的要提交这个申请么？",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#33FF33",
            confirmButtonText: "是的",
            cancelButtonText: "取消",
            closeOnConfirm: true
        }, function (isConfirm) {
            if (isConfirm) {
                $.post("{:url('tijiao')}",{id:id},function(re){
                    var data=JSON.parse(re);
                    if(data["state"]==1){
                        location.href='{:url("index2")}'
                    }else{
                        alert(data["msg"]);
                    }
                })
            }
        })
    }
    //取消
    function qx(id){
         swal({
            title: "提示",
            text: "您真的要取消这个申请么？",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#FF3333",
            confirmButtonText: "是的",
            cancelButtonText: "取消",
            closeOnConfirm: true
        }, function (isConfirm) {
            if (isConfirm) {
                $.post("{:url('qx')}",{id:id},function(re){
                    var data=JSON.parse(re);
                    if(data["state"]==1){
                        location.href='{:url("index2")}'
                    }else{
                        alert(data["msg"]);
                    }
                })
            }
        })
    }
    //日期范围限制
    var start = {
        elem: '#start',
        format: 'YYYY-MM-DD',
       // min: laydate.now(), //设定最小日期为当前日期
        max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end',
        format: 'YYYY-MM-DD',
       // min: laydate.now(),
        max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    
        $("#check").click(function(){
              
              $(".formpage").submit();
        })
        $("#clear_check").click(function(){
            $("input[type='text']").val("");
            $("#state").val(0);
             $(".formpage").submit();
        })
</script>
</body>

</html>
